i want to detect if my app (dotnet core 6.0 console) on Linux (Raspibian OS) is running as systemd. Reason is that my app is using OpenCV and it can, if configured, show live video. But if someone forget to set this configuration properly, and app want to show live video when running as systemd, it crashes.
Can someone give me a tip how to do this?
I have found on MSDN this:
Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive);
but it doesn't work for Linux.